package agent.handler.bs;

import cn.hutool.log.StaticLog;
import common.body.ClientConnectSuccessBody;
import common.handler.AbstractBsHandler;
import common.packet.BsPacket;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.tio.core.ChannelContext;

/**
 * @author gitama
 * @version 1.0
 * @date 2022/12/05
 */
public class ClientConnectSuccessResHandler extends AbstractBsHandler<ClientConnectSuccessBody> {


    @Override
    public Class<ClientConnectSuccessBody> bodyClass() {
        return ClientConnectSuccessBody.class;
    }

    @Override
    public void handler(BsPacket packet, ClientConnectSuccessBody bsBody, ChannelContext channelContext) throws Exception {
        StaticLog.info("连接成功~~");
        StaticLog.info("当前通道协议:{}", bsBody.getProtocol());
        StaticLog.info("访问域名地址:{}", bsBody.getHost());
    }

}
